<!doctype html>
<html xmlns:th="http://www.thymeleaf.org" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>也许有用 技术论坛 - MAYBE IT WORKS</title>
    <link th:href="@{/show/css/bootstrap.min.css}" type="text/css" rel="stylesheet">
    <link th:href="@{/show/css/style.css}" type="text/css" rel="stylesheet">
    <link type="text/css" th:href="@{/show/css/nprogress.css}" rel="stylesheet">
    <!--[if lt IE 9]>
    <script src="js/html5shiv.min.js" type="text/javascript"></script>
    <script src="js/respond.min.js" type="text/javascript"></script>
    <script src="js/selectivizr-min.js" type="text/javascript"></script>
    <![endif]-->
    <link rel="icon" th:href="@{/show/images/icon/favicon.ico}" type="image/x-icon"/>
    <link rel="bookmark" th:href="@{/show/images/icon/favicon.ico}" type="image/x-icon"/>
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <link rel="stylesheet" th:href="@{/show/css/imgSizeSmall.css}">
    <script th:src="@{/layui/layui.js}"></script>

    <meta name="Keywords" content="" />
    <meta name="description" content="" />
    <style>
        .title1  ul{
            list-style-type: none;
            padding: 0px;
            float: left;
            position: relative;
        }
        .title1 ul li {
            width: 50px;
            height: 36px;
            text-align: center;
            float: left;
        }
        .title1 ul li a {     color: #848789;
            font-size: 14px;
            text-decoration: none;
            line-height: 36px; }
        .title1 ul a:hover{     color:  #0ab2d2; }
        .title1 .move{     height: 4px;
            width: 50px;
            border-top: 4px solid  #0ab2d2;/*只需要将上边显示出来*/
            position: absolute;
            left: 0;
            top: 32px;
            transition: left .2s ease-in-out 0s;/*包含四个过度属性：执行变换属性、执行时间、速率、延迟*/
            -webkit-transition: left .2s ease-in-out 0s;/*chrome和safari*/
            -moz-transition: left .2s ease-in-out 0s;/*firefox*/
            -o-transition: left .2s ease-in-out 0s;/*opera*/ }
        .contentDiv1{
            display:inline-block;
            margin:5px 15px;
            width:65px;
            height:65px;
            border-radius:100px;
            -webkit-border-radius:100px;
            -moz-border-radius:100px;
            border:2px solid #fff;
            box-shadow:0 0 4px #ccc;
            overflow:hidden;
        }
    </style>
</head>
<body>
<section class="container user-select">
    <header th:replace="~{show/main :: leftbar}"></header>
    <!--/超小屏幕可见-->
    <div class="content-wrap"><!--内容-->
        <div class="content">
            <div class="content-block new-content">
                <h2 class="title"><strong>搜索中心</strong></h2>
                <div id="search" class="sidebar-block search" role="search">
                    <form class="navbar-form">
                        <div class="input-group">
                            <input id="searchType"  type="hidden" th:value="${searchType}">
                            <input type="text"  id="like" th:value="${like}" class="form-control" size="80" placeholder="请输入关键字">
                            <span class="input-group-btn">
	                           <button id="searchAll" class="btn btn-default btn-search" style="width: 150px;" type="button" >搜索</button>
                            </span>
                        </div>
                        <div class="title1">
                            <ul>
                                <li><a th:href="@{/so/search}" id="boke" >博客</a></li>
                                <li><a th:href="@{/so/search}+'?searchType=ziyuan&like='+${like}" id="ziyuan">资源</a></li>
                                <li><a th:href="@{/so/search}+'?searchType=users&like='+${like}" id="users" >用户</a></li>
                                <li id="move" class="move"> </li>
                            </ul>
                        </div>
                    </form>
                </div>
                <div th:if="${searchType=='boke'}">
                    <div class="row">
                        <div class="news-list" th:each="page:${articlePages.getRecords()}" >
                            <div class="news-img col-xs-5 col-sm-5 col-md-4">
                                <a target="_blank" th:href="@{/show/content/}+${page.getArticleId()}" >
                                    <img th:src="@{/show/images/logo.jpg}" alt="">
                                </a>
                            </div>
                            <div class="news-info col-xs-7 col-sm-7 col-md-8">
                                <dl >
                                    <dt> <a th:href="@{/show/content/}+${page.getArticleId()}" target="_blank" th:text="${page.getTitle()}"> 异清轩技术博客正式上线！ </a> </dt>
                                    <dd><span class="name"><a href="" th:text="${page.getAuthor()}" th:title="'由'+${page.getAuthor()}+'发布'" title="由 异清轩 发布" rel="author">异清轩</a></span> <span class="identity"></span> <span class="time" th:text="${#dates.format(page.getCreateTime(),'yyyy-MM-dd HH:mm:ss')}"> 2015-10-19 </span>&nbsp;&nbsp;&nbsp;<span th:if="${page.getTop =='1'}" class="glyphicon glyphicon-plane" style="color: #3399CC"></span></dd>
                                    <dd class="text" th:text="${page.getDescription()}">欢迎来到异清轩技术博客，在这里可以看到网站前端和后端的技术，还有CMS内容管理系统，包括但不限于这些还有CMS内容管理系统，包括但不限于这些。</dd>
                                </dl>
                                <div class="news_bot col-sm-7 col-md-8"> <span class="tags visible-lg visible-md" > <a href="" th:each="tag:${#strings.arraySplit(page.getTags(),';')}" th:text="${tag}">本站</a> </span> <span class="look"> 共 <strong th:text="${page.getHits()}">2126</strong> 人围观，发现 <strong th:text="${page.getHits()-page.getZan()}"> 12 </strong> 个不明物体 </span> </div>
                            </div>
                        </div>
                    </div>
                    <div class="quotes" style="margin-top:15px" th:if="${articlePages.getPages()>8}">
                        <input id="page" type="hidden" th:value="${articlePages.getCurrent()}">
                        <input id="page_end" type="hidden" th:value="${articlePages.getPages()}">
                        <span class="disabled" th:if="${articlePages.getCurrent()==1}">首页</span>
                        <a th:onclick="page(0)"  th:if="${articlePages.getCurrent()!=1}">首页</a>
                        <span class="disabled" th:if="${articlePages.getCurrent()==1}">上一页</span>
                        <a th:onclick="page(1)" th:if="${articlePages.getCurrent()!=1}">上一页</a>
                        <font th:each="index : ${#numbers.sequence(1, articlePages.getPages())}">
                            <a th:href="@{/so/search}+'?pageNum='+${index}+'&searchType='+${searchType}+'&like='+${like}" th:if="${index!=articlePages.getCurrent()}" th:text="${index}">2</a>
                            <span class="current" th:if="${index==articlePages.getCurrent()}" th:text="${articlePages.getCurrent()}">1</span>
                        </font>
                        <span class="disabled" th:if="${articlePages.getCurrent()==articlePages.getPages()}">下一页</span>
                        <a th:onclick="page(2)" th:if="${articlePages.getCurrent()!=articlePages.getPages()}">下一页</a>
                        <span class="disabled" th:if="${articlePages.getCurrent()==articlePages.getPages()}">尾页</span>
                        <a th:onclick="page(3)" th:if="${articlePages.getCurrent()!=articlePages.getPages()}">尾页</a>
                    </div>
                </div>
                <div th:if="${searchType=='ziyuan'}">
                    <div class="row">
                        <div class="news-list" th:each="page:${datafilePages.getRecords()}">
                            <div class="news-img col-xs-3 col-sm-3 col-md-2" >
                                <a target="_blank" th:href="@{/show/fileContent/}+${page.getFileId()}" >
                                    <img th:src="@{/show/images/filetype/}+${page.getType}+'.png'" alt="">
                                </a>
                            </div>
                            <div class="news-info col-xs-7 col-sm-7 col-md-10">
                                <dl >
                                    <dt> <a th:href="@{/show/fileContent/}+${page.getFileId()}" target="_blank" th:text="${page.getTitle()}"> 异清轩技术博客正式上线！ </a> </dt>
                                    <dd>
                                    <span class="name">
                                        <a href="" th:text="${page.getAuthor()}" th:title="'由'+${page.getAuthor()}+'发布'" title="由 异清轩 发布" rel="author">异清轩</a>
                                    </span> <span class="identity"></span> <span class="time" th:text="${#dates.format(page.getCreateTime(),'yyyy-MM-dd HH:mm:ss')}"> 2015-10-19 </span>
                                    </dd>
                                    <dd class="text" th:text="${page.getDescription()}">欢迎来到异清轩技术博客，在这里可以看到网站前端和后端的技术，还有CMS内容管理系统，包括但不限于这些还有CMS内容管理系统，包括但不限于这些。</dd>
                                </dl>
                            </div>
                        </div>
                    </div>
                    <div class="quotes" style="margin-top:15px" th:if="${datafilePages.getPages()>1}">
                        <input id="data_page" type="hidden" th:value="${datafilePages.getCurrent()}">
                        <input id="data_page_end" type="hidden" th:value="${datafilePages.getPages()}">
                        <span class="disabled" th:if="${datafilePages.getCurrent()==1}">首页</span>
                        <a th:onclick="page(0)"  th:if="${datafilePages.getCurrent()!=1}">首页</a>
                        <span class="disabled" th:if="${datafilePages.getCurrent()==1}">上一页</span>
                        <a th:onclick="page(1)" th:if="${datafilePages.getCurrent()!=1}">上一页</a>
                        <font th:each="index : ${#numbers.sequence(1, datafilePages.getPages())}">
                            <a th:href="@{/so/search}+'?pageNum='+${index}+'&searchType='+${searchType}+'&like='+${like}" th:if="${index!=datafilePages.getCurrent()}" th:text="${index}">2</a>
                            <span class="current" th:if="${index==datafilePages.getCurrent()}" th:text="${datafilePages.getCurrent()}">1</span>
                        </font>
                        <span class="disabled" th:if="${datafilePages.getCurrent()==datafilePages.getPages()}">下一页</span>
                        <a th:onclick="page(2)" th:if="${datafilePages.getCurrent()!=datafilePages.getPages()}">下一页</a>
                        <span class="disabled" th:if="${datafilePages.getCurrent()==datafilePages.getPages()}">尾页</span>
                        <a th:onclick="page(3)" th:if="${datafilePages.getCurrent()!=datafilePages.getPages()}">尾页</a>
                    </div>
                </div>
                <div th:if="${searchType=='users'}">
                    <div class="row">
                        <div class="news-list" th:each="page:${users}">
                            <div class="news-img col-xs-3 col-sm-3 col-md-2" >
                                <a class="contentDiv1" target="_blank" th:href="@{/userCenter/show/}+${page.getUserId()}" >
                                    <img th:src="@{/upload/userimg/}+${page.getWallet().getAvatar()}" alt="">
                                </a>
                            </div>
                            <div class="news-info col-xs-3 col-sm-6 col-md-8">
                                <dl>
                                    <dt> <a th:href="@{/userCenter/show/}+${page.getUserId()}" target="_blank" th:text="${page.getUserAccount()}"> 异清轩技术博客正式上线！ </a> </dt>
                                    <dd>
                                        <strong class="layui-text" th:text="'文章 '+${page.getStatistic().getArticlenum()}">文章</strong>
                                        <strong class="layui-text" th:text="'阅读 '+${page.getStatistic().getHits()}">阅读</strong>
                                        <strong class="layui-text" th:text="'点赞 '+${page.getStatistic().getZan()}">点赞</strong>
                                    </dd>
                                    <dd class="text" th:text="${page.getWallet().getUserinfo()}">欢迎来到异清轩技术博客，在这里可以看到网站前端和后端的技术，还有CMS内容管理系统，包括但不限于这些还有CMS内容管理系统，包括但不限于这些。</dd>
                                </dl>
                            </div>
                            <div class="news-info col-xs-1 col-sm-1 col-md-2">
                                <button th:onclick="'javascript:follow(\''+${page.getUserId()}+'\')'" class="layui-btn layui-btn-primary layui-border-blue layui-btn-radius" style="width: 100px" th:text="${page.getFollow()}">关1注</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--/内容-->
    <aside class="sidebar visible-lg"><!--右侧>992px显示-->
        <div class="sentence"> <strong>每日一句</strong>
            <h2 id="date">2015年11月1日 星期日</h2>
            <p id="selfwords">你是我人生中唯一的主角，我却只能是你故事中的一晃而过得路人甲。</p>
        </div>
        <div class="sidebar-block recommend">
            <h2 class="title"><strong>热门推荐</strong></h2>
            <ul th:each="article:${hots}">
                <li><a target="_blank" th:href="@{/show/content/}+${article.getArticleId()}"> <span class="thumb"><img th:src="@{/show/images/icon/icon.png}" alt=""></span> <span class="text" th:text="${article.getTitle()}">异清轩技术博客的SHORTCUT和ICON图标 ...</span> <span class="text-muted">阅读(<font th:text="${article.getHits()}"></font>)</span></a></li>
            </ul>
        </div>
    </aside>
    <!--/右侧>992px显示-->
    <footer class="footer" th:fragment="bottombar">POWERED BY &copy;<a href="http://39.107.119.38:8886/view/index">赵家宝 MyBlog.com</a> ALL RIGHTS RESERVED &nbsp;&nbsp;&nbsp;<span><a href="http://www.miitbeian.gov.cn/" target="_blank">豫ICP备15026801号-1</a></span> <span style="display:none"><a href="">网站统计</a></span> </footer>
</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script th:src="@{/show/js/jquery-2.1.4.min.js}" type="text/javascript"></script>
<script th:src="@{/show/js/nprogress.js}" type="text/javascript" ></script>
<script th:src="@{/show/js/bootstrap.min.js}" type="text/javascript"></script>
<script th:src="@{/show/js/comm/right.js}" type="text/javascript"></script>
<script type="text/javascript">
    //页面加载
    $('body').show();
    $('.version').text(NProgress.version);
    NProgress.start();
    setTimeout(function() { NProgress.done(); $('.fade').removeClass('out'); }, 1000);
    //返回顶部按钮
    $(function(){
        $(window).scroll(function(){
            if($(window).scrollTop()>100){
                $(".gotop").fadeIn();
            }
            else{
                $(".gotop").hide();
            }
        });
        $(".gotop").click(function(){
            $('html,body').animate({'scrollTop':0},500);
        });
    });
    //提示插件启用
    $(function () {
        $('[data-toggle="popover"]').popover();
    });
    $(function () {
        $('[data-toggle="tooltip"]').tooltip();
    });
    //鼠标滑过显示 滑离隐藏
    $(function(){
        $(".carousel").hover(function(){
            $(this).find(".carousel-control").show();
        },function(){
            $(this).find(".carousel-control").hide();
        });
    });
    $(function(){
        $(".hot-content ul li").hover(function(){
            $(this).find("h3").show();
        },function(){
            $(this).find("h3").hide();
        });
    });
    //页面元素智能定位
    $.fn.smartFloat = function() {
        var position = function(element) {
            var top = element.position().top; //当前元素对象element距离浏览器上边缘的距离
            var pos = element.css("position"); //当前元素距离页面document顶部的距离
            $(window).scroll(function() { //侦听滚动时
                var scrolls = $(this).scrollTop();
                if (scrolls > top) { //如果滚动到页面超出了当前元素element的相对页面顶部的高度
                    if (window.XMLHttpRequest) { //如果不是ie6
                        element.css({ //设置css
                            position: "fixed", //固定定位,即不再跟随滚动
                            top: 0 //距离页面顶部为0
                        }).addClass("shadow"); //加上阴影样式.shadow
                    } else { //如果是ie6
                        element.css({
                            top: scrolls  //与页面顶部距离
                        });
                    }
                }else {
                    element.css({ //如果当前元素element未滚动到浏览器上边缘，则使用默认样式
                        position: pos,
                        top: top
                    }).removeClass("shadow");//移除阴影样式.shadow
                }
            });
        };
        return $(this).each(function() {
            position($(this));
        });
    };
    //启用页面元素智能定位
    $(function(){
        $("#search").smartFloat();
    });
    //异步加载更多内容
    jQuery("#pagination a").on("click", function ()
    {
        var _url = jQuery(this).attr("href");
        var _text = jQuery(this).text();
        jQuery(this).attr("href", "javascript:viod(0);");
        jQuery.ajax(
            {
                type : "POST",
                url : _url,
                success : function (data)
                {
                    //将返回的数据进行处理，挑选出class是news-list的内容块
                    result = jQuery(data).find(".row .news-list");
                    //newHref获取返回的内容中的下一页的链接地址
                    nextHref = jQuery(data).find("#pagination a").attr("href");
                    jQuery(this).attr("href", _url);
                    if (nextHref != undefined)
                    {
                        jQuery("#pagination a").attr("href", nextHref);
                    }
                    else
                    {
                        jQuery("#pagination a").html("下一页没有了").removeAttr("href")
                    }
                    // 渐显新内容
                    jQuery(function ()
                    {
                        jQuery(".row").append(result.fadeIn(300));
                        jQuery("img").lazyload(
                            {
                                effect : "fadeIn"
                            });
                    });
                }
            });
        return false;
    });
</script>
<script th:inline="javascript">
    $(function () {
        var type=$("#searchType").val();
        if (type=="users"){
            $("#users").css("color","#0ab2d2");
            $("#move").css("left","100px");
        }else if (type=="ziyuan"){
            $("#ziyuan").css("color","#0ab2d2");
            $("#move").css("left","50px");
        }else {
            $("#boke").css("color","#0ab2d2");
            $("#move").css("left","0px");
        }
    });
    $("#searchAll").click(function () {
        var like=$("#like").val();
        var searchType=[[${searchType}]];
        window.location.href="/so/search?searchType="+searchType+"&like="+like;
    });
    function page(x) {
        var like=$("#like").val();
        var searchType=[[${searchType}]];
        var  page=null;
        var end_page=null;
        if (searchType=='ziyuan'){
            page=$("#data_page").val();
            end_page=$("#data_page_end").val();
        }else if (searchType=='users'){

        }else {
            page=$("#page").val();
            end_page=$("#page_end").val();
        }
        var downPage = parseInt(page)+1;
        var topPage = parseInt(page)-1;
        //首页
        if (x==0){
            window.location.href="/so/search?searchType="+searchType+"&pageNum="+1+"&like="+like;
        }
        if (x==1){
            alert("上");
            window.location.href="/so/search?searchType="+searchType+"&pageNum="+topPage+"&like="+like;
        }
        if (x==2){
            alert("下");
            window.location.href="/so/search?searchType="+searchType+"&pageNum="+downPage+"&like="+like;
        }
        if (x==3){
            alert("下");
            window.location.href="/so/search?searchType="+searchType+"&pageNum="+end_page+"&like="+like;
        }
    }
    layui.use('layer', function() {

    });

    function follow(fid) {
        /*var that = event.currentTarget;*/
        var that=$(event.target);
        $.ajax({
            type: 'post',
            url: '/so/isFollow/'+fid,
            dataType: "text",
            async: false,
            success: function (data) {
                var res = Array;
                if (data == 1) {
                    res[0] = '关注成功';
                    res[1] = '1';
                    that.text("已关注");
                    //    layer.msg('修改成功', {icon: 1});
                } else if (data==2){
                    res[0] = '请先登录';
                    res[1] = '0'
                    //    layer.msg('修改失败', {icon: 2});
                }else if (data==3){
                    res[0] = '不能关注自己';
                    res[1] = '0'
                    //    layer.msg('修改失败', {icon: 2});
                }else if (data==4){
                    res[0] = '取消关注';
                    res[1] = '1'
                    that.text("关注");
                    //    layer.msg('修改失败', {icon: 2});
                }
                /*window.parent.location.reload();//刷新父页面*/
                layer.msg(res[0], {icon: res[1]});
            }
        });
    }
</script>
</body>
</html>
